//
//  UIBarButtonItem+Item.m
//  WBBaseProject
//
//  Created by 吴斌 on 2017/6/29.
//  Copyright © 2017年 吴斌. All rights reserved.
//

#import "UIBarButtonItem+Item.h"

@implementation UIBarButtonItem (Item)

//自定义barButtonItem
+ (UIBarButtonItem *)wb_barButtonItemWithImage:(UIImage *)image
                                     highImage:(UIImage *)highImage
                                        target:(id)target
                                        action:(SEL)action
                              forControlEvents:(UIControlEvents)controlEvents{
    // btn
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:image forState:UIControlStateNormal];
    [btn setBackgroundImage:highImage forState:UIControlStateHighlighted];
    [btn sizeToFit];
    [btn addTarget:target action:action forControlEvents:controlEvents];
    return [[UIBarButtonItem alloc] initWithCustomView:btn];
}

@end
